var playerUIApp = new Vue({
	el: '#playerUIApp',
	data: {
		isShowPlayInfo: true,
		playerScoreList: [{
			"id": 13,
			"userId": 89,
			"bulletCount": 80,
			"lifeValue": 228,
			"fightScore": 35,
			"goldCoin":15,
			"userName": "本人。",
			 "value":1
		},{
			"id": 13,
			"userId": 15,
			"bulletCount": 80,
			"lifeValue": 228,
			"fightScore": 35,
			"goldCoin":16,
			"userName": "未知，请刷新。",
			 "value":1
		}
		]

	},
	mounted() {


	},
	methods: {
		ClosePlayInfoWindow() {
			//playerUIApp.isShowPlayInfo = false;
			document.getElementById("playerUIApp").style.left ="10000px";
		},
		AddPlayerLife(index, _userId) {

			var addLifeValue = this.$refs.input1[index-1].value;
			if ("undefined" == typeof addLifeValue || addLifeValue == 0) {
				mui.toast('命值不能为空，请重试！');
				return;
			}
			
			var url = "uniwebview://transferPlayerLifeBulletCount?userId=" + 
			_userId + "&addLifeValue=" + addLifeValue + "&addBulletCount=0&currentUser=" + userId;
			if(!isTest)
			{
				window.location.href = url;
			}
		},
		AddBulletCount(index, _userId) {
		
			var addBulletCount = this.$refs.input2[index-1].value;
			if ("undefined" == typeof addBulletCount || addBulletCount == 0) {
				mui.toast('弹量不能为空，请重试！');
				return;
			}
			
			var url = "uniwebview://transferPlayerLifeBulletCount?userId=" + 
			_userId + "&addLifeValue=0&addBulletCount=" + addBulletCount + "&currentUser=" + userId;
			if(!isTest)
			{
				window.location.href = url;
			}
			
		
		},
		handleChange(value) {
			//console.log(value);
		},
		handleChange1(value) {
			//console.log(value);
		},

	}
})

function GetRoomLifeInfoByUser(data) {
	var _json = JSON.stringify(data);
	var dataResult = JSON.parse(_json);
	playerUIApp.playerScoreList = dataResult;
}

function AddPlayerLifeMessageShow(message) {

	if (message == 0) {
		mui.alert("命值或弹量操作成功");
		GetPlayerLifeListInfo();
	} else {
		mui.alert("操作失败，您的命值或弹量不足");
	}

}